//
//  AlertView.m
//  FindJob
//
//  Created by 233 on 16/3/2.
//  Copyright © 2016年 Lee. All rights reserved.
//

#import "AlertView.h"

@interface AlertView ()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@end
@implementation AlertView

- (instancetype)initWithTitle:(NSString *)title {
    if (self == [super init]) {
        self = [[NSBundle mainBundle] loadNibNamed:@"AlertView" owner:self options:nil][0];
        self.frame = [UIScreen mainScreen].bounds;
        self.titleLabel.text = title;
    }
    return self;
}

- (void)show {
    [[UIApplication sharedApplication].keyWindow addSubview:self];
    [self performSelector:@selector(hide) withObject:self afterDelay:1.5f];
}

#pragma mark *** Private ***
- (void)hide {
    [self removeFromSuperview];
}

@end
